# frozen_string_literal: true

ActiveAdmin.register DecisionTableHeader do
  menu parent: ['Rules Engine'], priority: 3

  includes :schema_variable, :type_method

  index do
    id_column
    column :name
    column 'Decision Table' do |header|
      link_to "Decision Table ##{header.decision_table_id}", admin_rule_entity_path(header.decision_table_id)
    end
    column :schema_variable
    column :type_method

    actions
  end

  filter :decision_table
  filter :name, filters: %i[equals contains]
  filter :type_method
end
